import request from "@/utils/request";

const BASE_URL = "/grid-api/feedback";

class FeedbackAPI {
  static submitFeedback(data: any) {
    return request<any, any>({
      url: `${BASE_URL}/feedback`,
      method: "post",
      data: {
        fprovince: data.province,
        fcity: data.city,
        faddress: data.location,
        aqiPreId: data.aqi,
        finfo: data.feedback,
        fileUploadImgId: data.fileUploadImgId,
      },
      headers: {
        "Content-Type": "application/json",
      },
    });
  }

  static submitVerify(data: any) {
    return request<any, any>({
      url: `${BASE_URL}/submitVerify`,
      method: "post",
      data: {
        feedbackId: data.feedbackId,
        aqiVerId: data.aqiVerId,
        so2: data.so2,
        co: data.co,
        pm: data.pm,
      },
      headers: {
        "Content-Type": "application/json",
      },
    });
  }

  static feedbackList(data: any) {
    return request<any, any>({
      url: `${BASE_URL}/getFeedbackList`,
      method: "post",
      data,
      headers: {
        "Content-Type": "application/json",
      },
    });
  }
}

export default FeedbackAPI;
